<?php
/**
 *  购物车
*/

namespace app\api\service;

use app\api\model\Images;
use app\api\model\Inventory;
use app\api\model\Warehouse;
use app\api\service\CCNames as CCNamesService;
use app\api\service\ProductMerge as ProductMergeService;
use app\common\Calculate;
use app\common\RedisClient;
use app\facade\Basic;
use app\api\model\Carts as CartsModel;
use think\facade\Config;
use app\api\service\ProductPrice as ProductPriceService;

class Carts
{
    /**
     *  购物车列表
    */
    private $total_count = 0;
    private $total_amount = 0;
    private $advance_total_amount = 0;
    private $product_original_amount = 0;
    private $is_advance = 0;

    public function conditions($param)
    {
        $result = CartsModel::where('id','in',$param)->field('product_id,warehouse_id,arrival_date,is_futures,quantity')->select();
        $conditions = [];
        foreach ($result as $key => $value ) {
            $conditions[$key]['productid'] = $value->product_id;
            $conditions[$key]['wid'] = $value->warehouse_id;
            $conditions[$key]['arrival_date'] = $value->arrival_date;
            $conditions[$key]['is_futures'] = $value->is_futures;
            $conditions[$key]['quantity'] = $value->quantity;
        }
        return $conditions;
    }

    public function list($param)
    {

        $warehouse = Warehouse::field('id,show_name as name')->select()->toArray();

        $CartsList = CartsModel::with([
            'product' => function ($query){
              return $query->with([
                  'brand' => function ($query) {
                      return $query->field('id,name,image');
                  },
                  'category' => function ($query) {
                      return $query->field('id,name');
                  },
                  'inventory' => function ($query) {
                      return $query->field('id,productid,wid,available_qty,lock_qty,is_futures,arrival_date')
                          ->where('is_del','=',0)
                          ->where('is_sale','=',1)
                          ->whereRaw('`available_qty` > `lock_qty` OR  `allow_zero_stock_sale` = 1');
                  }
              ])->field('id,cname,category,brand,condition,expiration_date,hashrate,computing_unit,power,main_photo,photo,describe,estimated_ship_date,weight,type');
            },
            'warehouse' => function ($query) {
                return $query->field('id,show_name as name');
            }
        ])
            ->where('user_id',$param['user_id'])
            ->field('id,user_id,product_id,warehouse_id,arrival_date,is_futures,quantity')
            ->select();
        $CartsList = $CartsList->toArray();
        if( !$CartsList ) {
            return Basic::data(0,'common.success',[
                'list' => [],
                'total_count' => '0',
                'total_amount' => '0.00',
                'total_discount' => '0.00',
            ]);
        }
        $photoidsArr = [];
        foreach ($CartsList as $key => $value ) {
            $conditions[$key]['productid'] = $value['product_id'];
            $conditions[$key]['user_id'] = $param['user_id'];
            $conditions[$key]['wid'] = $value['warehouse_id'];
            $conditions[$key]['arrival_date'] = $value['arrival_date'];
            $conditions[$key]['is_futures'] = $value['is_futures'];
            $conditions[$key]['quantity'] = $value['quantity'];
            if(!empty($value['product']['main_photo']) ){
                $photoidsArr[]=$value['product']['main_photo'];
            }
            if ($value['product']['type'] == 2 && !empty($value['product']['photo'])) {
                $photoidsArr[] = explode(',', $value['product']['photo'])[0];
            }
        }
        $imageModel = new Images();
        $photoList = $imageModel->getImagesByIds($photoidsArr);

        // 将数组转换为以ID为下标的结构
        $photoList = array_column($photoList, null, 'id');

        /* 获取商品价格 */
        $ProductPriceService = new ProductPriceService();
        $ProductPrice = $ProductPriceService->getPrice($conditions);


        $ProductPrice = $ProductPrice['data']?? [];
        $data = [];
        $quantity_item = 0;
        $label = null;
        $common = new \app\api\service\Common();
        foreach ($CartsList as $key => &$value){

            $ikey = implode('_', [
                $value['product_id'],
                $value['warehouse_id'],
                $value['arrival_date'],
                $value['is_futures']
            ]);

            $value['price'] = $ProductPrice[$ikey]['price'] ?? '';
            $value['sales_price'] = $ProductPrice[$ikey]['sales_price'] ?? '';
//            $value['discount'] = $ProductPrice[$ikey]['discount'];

            $data[$key]['price'] = $ProductPrice[$ikey]['price'] ?? '';
            $data[$key]['sales_price'] = $value['sales_price'];
            $data[$key]['id'] = $value['id'];
            $data[$key]['quantity'] = $value['quantity'];
            $data[$key]['subtotal'] = '0.00';
            $data[$key]['arrival_date'] = $value['arrival_date'];
            $data[$key]['is_futures'] = $value['is_futures'];

            /* 仓库名称 */
            if ( !empty( $value['warehouse'] ) ) {
                $data[$key]['warehouse_id'] = $value['warehouse']['id'];
                $data[$key]['warehouse_name'] =  $common->singleTranslate($value['warehouse']['name'],$param['lang']);
            }

            /* 折扣 */
//            $data[$key]['discount'] = $value['discount'];

            /* 商品 */
            if ( !empty($value['product'] ) ) {
                $data[$key]['name'] = $common->singleTranslate($value['product']['cname'],$param['lang']);
                $data[$key]['product_id'] = $value['product']['id'];
                $data[$key]['condition'] = $value['product']['condition'];
                $data[$key]['unit'] = $value['product']['unit'];

                $data[$key]['hashrate'] = $value['product']['hashrate'] .' '.$value['product']['unit'];


                $data[$key]['power'] = $value['product']['power'];

                $data[$key]['expiration_date'] = $value['product']['expiration_date'];
                $data[$key]['weight'] = $value['product']['weight'];

                /* 分类 */
                if (!empty($value['product']['category'])){
                    $data[$key]['category_id'] = $value['product']['category']['id'] ?? null;
                    $data[$key]['category_name'] = $value['product']['category']['name'] ?? null;
                }

                /* 分类 */
                if (!empty($value['product']['brand'])){
                    $data[$key]['brand_id'] = $value['product']['brand']['id'] ?? null;
                    $data[$key]['brand_name'] = $value['product']['brand']['name'] ?? null;
                    $data[$key]['brand_name'] =  $common->singleTranslate($data[$key]['brand_name'],$param['lang']);
                    $data[$key]['brand_icon'] = Config::get('api.cdn').$value['product']['brand']['image'] ?? null;
                }

                /* 仓库列表 */
                if (!empty($value['product']['inventory'])){
                    $warehouse_list = [];
                    $widStr = '';
                    foreach ($value['product']['inventory'] as $inventory){
                        $widStr .= $inventory['wid'].',';
                    }

                    $widStr = substr($widStr, 0, -1);
                    $wids = explode(",", $widStr);
                    $wids = array_unique($wids);

                    foreach ( $warehouse as $w ) {
                        if(in_array($w['id'], $wids)){
                            $w['name'] = $common->singleTranslate($w['name'],$param['lang']);
                            $warehouse_list[] = $w;
                        }
                    }

                    $data[$key]['warehouse_list'] = $warehouse_list;
                }

                if(!empty($value['product']['photo']) && $value['product']['type'] == 2){
                    $photoKey = explode(',',$value['product']['photo'])[0];
                    $data[$key]['thumb'] =$photoList[$photoKey]['url'];
                }
                /* 缩略图 */
                if(!empty($value['product']['main_photo'])){
                    $data[$key]['thumb'] =$photoList[$value['product']['main_photo']]['url'];
                }

                // 计算数量
                //Calculate
                $this->total_count = Calculate::pricecalc($this->total_count,'+',$value['quantity'],0);

                // 计算小计
                if ($data[$key]['sales_price'] > 0) {
                    $data[$key]['subtotal'] = Calculate::pricecalc($value['quantity'],'*',$data[$key]['sales_price'],2);
                } else {
                    $data[$key]['subtotal'] = 0;
                }


                // 计算价格
                $this->total_amount = Calculate::pricecalc($this->total_amount,'+',$data[$key]['subtotal'],2);
                //$this->total_discount += $value['quantity'] * $value['inventory']['discount'][0]['price'];

            }
        }

        return Basic::data(0,'common.success',[
            'list' => $data,
            'total_count' => $this->total_count,
            'total_amount' => $this->total_amount,
            'total_discount' => '0.00',
        ]);
    }


    /**
     *  更具购物车ID 获取购物车列表
    */
    public function CartsList($param)
    {
        /* 获取仓库 */
        $warehouse = Warehouse::field('id,show_name as name')->select()->toArray();

        $CartsList = CartsModel::with([
            'product' => function ($query){
                return $query->with([
                    'brand' => function ($query) {
                        return $query->field('id,name,image');
                    },
                    'category' => function ($query) {
                        return $query->field('id,name');
                    },
                    'main_photo' => function ($query) {
                        return $query->field('id,url');
                    },
                    'inventory' => function ($query) {
                        return $query->field('id,productid,wid,available_qty,lock_qty,is_futures,arrival_date')
                            ->where('is_del','=',0)
                            ->where('is_sale','=',1)
                            ->whereRaw('(`available_qty` > `lock_qty` OR  `allow_zero_stock_sale` = 1 )');
                    }
                ])->field('id,cname,category,brand,condition,expiration_date,free_shipping,apply_rules,hashrate,computing_unit,power,main_photo,describe,estimated_ship_date,weight');
            },
            'warehouse' => function ($query) {
                return $query->field('id,show_name as name');
            }
        ])
            ->where('user_id',$param['user_id'])
            ->whereIn('id',$param['ids'])
            ->field('id,user_id,product_id,warehouse_id,arrival_date,is_futures,quantity')
            ->select();
        if( !$CartsList ) {
            return Basic::data(0,'common.success',[
                'cart' => [],
                'total_count' => '0',
                'total_amount' => '0.00',
                'total_discount' => '0.00',
            ]);
        }


        $CartsList = $CartsList->toArray();

        foreach ($CartsList as $key => $value ) {
            $conditions[$key]['productid'] = $value['product_id'];
            $conditions[$key]['user_id'] = $param['user_id'];
            $conditions[$key]['wid'] = $value['warehouse_id'];
            $conditions[$key]['arrival_date'] = $value['arrival_date'];
            $conditions[$key]['is_futures'] = $value['is_futures'];
            $conditions[$key]['quantity'] = $value['quantity'];
        }

        /* 获取商品价格 */
        $ProductPriceService = new ProductPriceService();
        $ProductPrice = $ProductPriceService->getPrice($conditions);


        $ProductPrice = $ProductPrice['data'];
        $data = [];
        $quantity_item = 0;
        $label = null;
        foreach ($CartsList as $key => &$value){

            $ikey = implode('_', [
                $value['product_id'],
                $value['warehouse_id'],
                $value['arrival_date'],
                $value['is_futures']
            ]);
            $value['price'] = $ProductPrice[$ikey]['price'];
            $value['sales_price'] = $ProductPrice[$ikey]['sales_price'];
//            $value['discount'] = $ProductPrice[$ikey]['discount'];

            $data[$key]['price'] = $ProductPrice[$ikey]['price'];
            $data[$key]['sales_price'] = $value['sales_price'];
            $data[$key]['id'] = $value['id'];
            $data[$key]['arrival_date'] = $value['arrival_date'];
            $data[$key]['is_futures'] = $value['is_futures'];
            $data[$key]['quantity'] = $value['quantity'];
            $data[$key]['subtotal'] = '0.00';

            /* 仓库名称 */
            if ( !empty( $value['warehouse'] ) ) {
                $data[$key]['warehouse_id'] = $value['warehouse']['id'];
                $data[$key]['warehouse_name'] = $value['warehouse']['name'];
            }

            /* 折扣 */
//            $data[$key]['discount'] = $value['discount'];

            /* 商品 */
            if ( !empty($value['product'] ) ) {
                $data[$key]['name'] = $value['product']['cname'];
                $data[$key]['product_id'] = $value['product']['id'];
                $data[$key]['condition'] = $value['product']['condition'];
                $data[$key]['unit'] = $value['product']['unit'];
                $data[$key]['free_shipping'] = $value['product']['free_shipping'];
                $data[$key]['apply_rules'] = $value['product']['apply_rules'];

                $data[$key]['hashrate'] = $value['product']['hashrate'] .' '.$value['product']['unit'];


                $data[$key]['power'] = $value['product']['power'];

                $data[$key]['expiration_date'] = $value['product']['expiration_date'];
                $data[$key]['weight'] = $value['product']['weight'];

                /* 分类 */
                if (!empty($value['product']['category'])){
                    $data[$key]['category_id'] = $value['product']['category']['id'];
                    $data[$key]['category_name'] = $value['product']['category']['name'];
                }

                /* 分类 */
                if (!empty($value['product']['brand'])){
                    $data[$key]['brand_id'] = $value['product']['brand']['id'];
                    $data[$key]['brand_name'] = $value['product']['brand']['name'];
                    $data[$key]['brand_icon'] = Config::get('api.cdn').$value['product']['brand']['image'];
                }

                /* 仓库列表 */
                if (!empty($value['product']['inventory'])){
                    $warehouse_list = [];
                    $widStr = '';
                    foreach ($value['product']['inventory'] as $inventory){
                        $widStr .= $inventory['wid'].',';
                    }

                    $widStr = substr($widStr, 0, -1);
                    $wids = explode(",", $widStr);
                    $wids = array_unique($wids);

                    foreach ( $warehouse as $w ) {
                        if(in_array($w['id'], $wids)){
                            $warehouse_list[] = $w;
                        }
                    }

                    $data[$key]['warehouse_list'] = $warehouse_list;
                }


                /* 缩略图 */
                if(!empty($value['product']['main_photo'])){
                    $data[$key]['thumb'] = $value['product']['main_photo']['url'];
                }

                // 计算数量
                //Calculate
                $this->total_count = Calculate::pricecalc($this->total_count,'+',$value['quantity'],0);

                // 计算小计
                if ($data[$key]['sales_price'] > 0) {
                    $data[$key]['subtotal'] = Calculate::pricecalc($value['quantity'],'*',$data[$key]['sales_price'],2);
                } else {
                    $data[$key]['subtotal'] = 0;
                }

                // 计算价格
                $this->total_amount = Calculate::pricecalc($this->total_amount,'+',$data[$key]['subtotal'],2);
                //$this->total_discount += $value['quantity'] * $value['inventory']['discount'][0]['price'];

            }
        }

        return [
            'cart' => $data,
            'total_count' => $this->total_count,
            'total_amount' => $this->total_amount,
            'product_original_amount' => $this->product_original_amount,
            'is_advance' => $this->is_advance,
            'advance_total_amount' => $this->advance_total_amount
        ];
    }

    /**
     *  添加购物车
    */
    public function wadd($param)
    {
        $where['productid'] = $param['product_id'];
        $where['is_futures'] = $param['is_futures'];
        $where['arrival_date'] = $param['arrival_date'];

        $inventory = Inventory::where($where)
            ->where(function ($query) {
                $query->where('available_qty','>',0)
                    ->whereOr(function ($query) {
                        $query->where('available_qty','=',0)->where('allow_zero_stock_sale','=',1);
                    });
            })
            ->whereFindInSet('wid', $param['warehouse_id'])
            ->field('id,wid,available_qty,lock_qty')
            ->select();

        if (!count($inventory)) {
            return Basic::data(0,'carts.inventoryIdNotExist');
        }

        $inventory = $inventory->toArray();


        /* 判断是否设置价格 */
        //db_product_price
//        $price_where[] = ['inventory_id','=',$inventory[0]['id']];
//        $price_where[] = ['transaction_currency_id','=','214'];
//        $ProductPrice = ProductPrice::where($price_where)->field('price')->find();
//
//        if (!$ProductPrice) {
//            return Basic::data(0,'carts.unableToAddToCart');
//        }

        $surplus = 9999;

        $where = [];
        $where['user_id'] = $param['user_id'];
        $where['product_id'] = $param['product_id'];
        $where['warehouse_id'] = $param['warehouse_id'];
        $where['is_futures'] = $param['is_futures'];
        $where['arrival_date'] = $param['arrival_date'];
        $result = CartsModel::where($where)->field('id,quantity')->find();

        if ( $result ) {

            /* 判断数量 */
            if ($surplus < ($result->quantity + $param['quantity'])) {
                return Basic::data(0,'carts.InsufficientInventoryQuantity');
            }

            /* 增进数量 */
            $result->quantity = Calculate::pricecalc($result->quantity,'+',$param['quantity'],0);

            if ( $result->save() ){
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        } else {

            /* 判断数量 */
            if ($surplus < $param['quantity']) {
                return Basic::data(0,'carts.InsufficientInventoryQuantity');
            }

            /* 添加到购物车 */
            $addData['user_id'] = $param['user_id'];
            $addData['product_id'] = $param['product_id'];
            $addData['warehouse_id'] = $param['warehouse_id'];
            $addData['is_futures'] = $param['is_futures'];
            $addData['arrival_date'] = $param['arrival_date'];
            $addData['quantity'] = $param['quantity'];
            $addData['create_time'] = date("Y-m-d H:i:s",time());
            $result = CartsModel::create($addData);

            if ( $result ){
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        }
    }


    /**
     *  Bulk 加入购物车
    */
    public function bulkAdd($param)
    {
        $redis = new RedisClient();
        $key = 'bulkAddcart_user_id:'.$param['user_id'];
        $surplus = 9999;
        $where = [];
        $where['user_id'] = $param['user_id'];
        $where['product_id'] = $param['product_id'];
        $where['warehouse_id'] = $param['warehouse_id'];
        $where['is_futures'] = $param['is_futures'];
        $where['arrival_date'] =  $param['arrival_date'];

        $result = CartsModel::where($where)->field('id,quantity')->find();

        if ( $result ) {

            /* 判断数量 */
            if ($surplus < ($result->quantity + $param['quantity'])) {
                return Basic::data(0,'carts.InsufficientInventoryQuantity');
            }

            /* 增进数量 */
            $result->quantity = Calculate::pricecalc($result->quantity,'+',$param['quantity'],0);

            if ( $result->save() ){
                $redis->set($key,true);
                $redis->setExpiry($key, 86400);
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        } else {

            /* 判断数量 */
            if ($surplus < $param['quantity']) {
                return Basic::data(0,'carts.InsufficientInventoryQuantity');
            }

            /* 添加到购物车 */
            $addData['user_id'] = $param['user_id'];
            $addData['product_id'] = $param['product_id'];
            $addData['warehouse_id'] = $param['warehouse_id'];
            $addData['is_futures'] = $param['is_futures'];
            $addData['arrival_date'] =  $param['arrival_date'];
            $addData['quantity'] = $param['quantity'];
            $addData['create_time'] = date("Y-m-d H:i:s",time());

            $result = CartsModel::create($addData);

            if ( $result ){

                $redis->set($key,true);
                $redis->setExpiry($key, 86400);
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        }


    }


    /**
     *  加入购物车
     */
    public function add($param)
    {
        $productMergeService = new ProductMergeService();
        $ccNamesService = new CCNamesService();
        $ccNameId = $ccNamesService->getCCNamesByIp($param['ip']);
        try {
            $result = $productMergeService->chooseInventoryDataByBatchAndCcnameId($param['sku_id'],$param['batch'], $ccNameId);
        } catch (\Exception $e) {
            return Basic::data(1,'carts.error',$e);
        }
        
        /* 判断库存数据是否存在 */
        if (!$result ) {
            return Basic::data(1,'carts.error');
        }
        $inventory = $result;
        $surplus = 9999;
        $where = [];
        $where['user_id'] = $param['user_id'];
        $where['product_id'] = $inventory['productid'];
        $where['warehouse_id'] = $inventory['wid'];
        $where['is_futures'] = $inventory['is_futures'];
        $where['arrival_date'] = ($inventory['arrival_date']) ?:null;
        $result = CartsModel::where($where)->field('id,quantity')->find();
        if ( $result ) {

            /* 判断数量 */
            if ($surplus < ($result->quantity + $param['quantity'])) {
                return Basic::data(1,'carts.InsufficientInventoryQuantity');
            }

            /* 增进数量 */
            $result->quantity = Calculate::pricecalc($result->quantity,'+',$param['quantity'],0);

            if ( $result->save() ){
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        } else {

            /* 判断数量 */
            if ($surplus < $param['quantity']) {
                return Basic::data(1,'carts.InsufficientInventoryQuantity');
            }

            /* 添加到购物车 */
            $addData['user_id'] = $param['user_id'];
            $addData['product_id'] = $inventory['productid'];
            $addData['warehouse_id'] = $inventory['wid'];
            $addData['is_futures'] = $inventory['is_futures'];
            $addData['arrival_date'] = $inventory['arrival_date'] ?: null;
            $addData['quantity'] = $param['quantity'];
            $addData['create_time'] = date("Y-m-d H:i:s",time());

            $result = CartsModel::create($addData);

            if ( $result ){
                return Basic::data(0,'carts.success');
            } else {
                return Basic::data(1,'carts.error');
            }

        }


    }

    /**
     *  更新购物车
     */
    public function update($param)
    {

        $where['user_id'] = $param['user_id'];
        $where['id'] = $param['id'];

        $result = CartsModel::where($where)->field('id,product_id,warehouse_id,is_futures,arrival_date')->find();

        if ( !$result ){
            return Basic::data(1,'carts.shoppingCartNotExist');
        }

        $where = [];
        $where['productid'] = $result->product_id;
        $where['is_futures'] = $result->is_futures;
        $where['arrival_date'] = $result->arrival_date;
        $where['is_sale'] = 1;

        /* 修改仓库 */
        if (!empty($param['warehouse_id']) ) {
            $result->warehouse_id =  $param['warehouse_id'];
        }

        /* 数量 */
        if( !empty($param['quantity']) ){
            $result->quantity = $param['quantity'];
        }
//->whereRaw('FIND_IN_SET(? , wid) > 0', [$result->warehouse_id])
        //->whereFindInSet('wid', $result->warehouse_id)
        $inventory = Inventory::where($where)->whereFindInSet('wid', $result->warehouse_id)->select();



        if (!count($inventory)) {
            return Basic::data(1,'carts.inventoryIdNotExist');
        }

        $inventory = $inventory->toArray();


//        $available_qty = 0;
//        $lock_qty = 0;
//        foreach ($inventory as $value) {
//            $available_qty = Calculate::pricecalc($available_qty,'+',$value['available_qty'],0);
//            $lock_qty = Calculate::pricecalc($lock_qty,'+',$value['lock_qty'],0);
//        }

        //$surplus = Calculate::pricecalc($available_qty,'-',$lock_qty,0);
        /* 上限数量 */
        $surplus = 9999;

        if ($surplus < $result->quantity) {
            return Basic::data(1, 'carts.InsufficientInventoryQuantity');
        }

        if ( $result->save() ){
            return Basic::data(0,'carts.success');
        } else {
            return Basic::data(1,'carts.error');
        }

    }

    /**
     *  移出购物车
    */
    public function remove($param)
    {
        $where['user_id'] = $param['user_id'];
        $where['id'] = $param['id'];

        $result = CartsModel::where($where)->field('id')->find();
        if( !$result ){
            return Basic::data(1,'carts.shoppingCartNotExist');
        }

        if ( $result->delete() ){
            return Basic::data(0,'common.success');
        } else {
            return Basic::data(1,'common.error');
        }
    }

    /**
     *  清空购物车
    */
    public function clearAll($param)
    {
        $where['user_id'] = $param['user_id'];

        $result = CartsModel::where($where)->delete();


        if ( $result ){
            return Basic::data(0,'common.success');
        } else {
            return Basic::data(1,'common.error');
        }
    }

    /**
     *  更具 ID 删除购物车
    */
    public function delCartById($param)
    {
        return CartsModel::where('user_id',$param['user_id'])
            ->where('id','in',$param['ids'])
            ->delete();
    }

    /**
     *  获取所有购物车
    */
    public function getAll($param)
    {

        $where['user_id'] = $param['user_id'];
        $result = CartsModel::where($where)->field('id,product_id,warehouse_id,is_futures,arrival_date,quantity')->select();

        if ( $result ){
            return Basic::data(0,'common.success',['data' => $result]);
        } else {
            return Basic::data(1,'common.error');
        }
    }


    /**
     *  查询用户数量
    */
    public function getCartCount($param)
    {
        $where['user_id'] = $param['user_id'];
        return CartsModel::where($where)->field('quantity')->sum('quantity');
    }





}
